package com.dp.show.www;

import android.content.Context;

import com.lib.showfield.app.AppConfig;
import com.lib.showfield.app.BaseApplication;

import cat.ereza.customactivityoncrash.config.CaocConfig;

public class MyApplication extends BaseApplication {

    public static MyApplication instance;


    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        // Crash 捕捉界面
        CaocConfig.Builder.create()
                .backgroundMode(CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM)
                .enabled(BuildConfig.DEBUG)
                .trackActivities(true)
                .minTimeBetweenCrashesMs(2000)
                // 重启的 Activity
                .restartActivity(MainActivity.class)
                // 错误的 Activity
                .errorActivity(CrashActivity.class)
                // 设置监听器
                //.eventListener(new YourCustomEventListener())
                .apply();
    }


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
    }
}
